﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Excel;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_RptSoNhatKyChiTien : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvTaiKhoan")]
        private ADVAccount _AdvTaiKhoan;
        [AccessedThroughProperty("CmdCancel")]
        private System.Windows.Forms.Button _CmdCancel;
        [AccessedThroughProperty("CmdExel")]
        private System.Windows.Forms.Button _CmdExel;
        [AccessedThroughProperty("CmdLoad")]
        private System.Windows.Forms.Button _CmdLoad;
        [AccessedThroughProperty("CmdPrint")]
        private System.Windows.Forms.Button _CmdPrint;
        [AccessedThroughProperty("Label1")]
        private System.Windows.Forms.Label _Label1;
        [AccessedThroughProperty("Label13")]
        private System.Windows.Forms.Label _Label13;
        [AccessedThroughProperty("Label2")]
        private System.Windows.Forms.Label _Label2;
        [AccessedThroughProperty("Label3")]
        private System.Windows.Forms.Label _Label3;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel2")]
        private Panel _Panel2;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtTongCong")]
        private C1NumericEdit _TxtTongCong;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private clsDMTaiKhoan objTK;

        public Frm_RptSoNhatKyChiTien()
        {
            base.FormClosing += new FormClosingEventHandler(this.Frm_RptSoNhatKyThuTien_FormClosing);
            base.Load += new EventHandler(this.Frm_RptSoNhatKyThuTien_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.objTK = new clsDMTaiKhoan();
            this.InitializeComponent();
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdExel_Click(object sender, EventArgs e)
        {
            try
            {
                SaveFileDialog dialog = new SaveFileDialog {
                    Filter = "Excel Files|*.xls",
                    Title = "Save an Excel file"
                };
                dialog.ShowDialog();
                if (dialog.FileName != "")
                {
                    this.VSlist.SaveExcel(dialog.FileName, "NKThuTien", FileFlags.IncludeFixedCells);
                    Excel.Application application = new ApplicationClass();
                    Workbook workbook = application.Workbooks.Open(dialog.FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
                    Excel.Application application2 = application;
                    NewLateBinding.LateCall(application2.Worksheets[1], null, "Select", new object[0], null, null, null, true);
                    application2.Cells.Select();
                    object instance = NewLateBinding.LateGet(application2.Selection, null, "Font", new object[0], null, null, null);
                    NewLateBinding.LateSetComplex(instance, null, "Name", new object[] { "Times New Roman" }, null, null, false, true);
                    NewLateBinding.LateSetComplex(instance, null, "Size", new object[] { 10 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(instance, null, "Strikethrough", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(instance, null, "Superscript", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(instance, null, "Subscript", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(instance, null, "OutlineFont", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(instance, null, "Shadow", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(instance, null, "Underline", new object[] { -4142 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(instance, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(instance, null, "ThemeFont", new object[] { 0 }, null, null, false, true);
                    instance = null;
                    application2.get_Range("B2:B3", Missing.Value).Select();
                    NewLateBinding.LateCall(application2.Selection, null, "ClearContents", new object[0], null, null, null, true);
                    application2.get_Range("B1:B3", Missing.Value).Select();
                    object selection = application2.Selection;
                    NewLateBinding.LateSetComplex(selection, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(selection, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(selection, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(selection, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(selection, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(selection, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(selection, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(selection, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(selection, null, "MergeCells", new object[] { false }, null, null, false, true);
                    selection = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    application2.get_Range("D1", Missing.Value).Select();
                    NewLateBinding.LateCall(application2.Selection, null, "ClearContents", new object[0], null, null, null, true);
                    application2.get_Range("C1:D1", Missing.Value).Select();
                    object obj4 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj4, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj4, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj4, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj4, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj4, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj4, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj4, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj4, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj4, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj4 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    application2.get_Range("C3", Missing.Value).Select();
                    NewLateBinding.LateCall(application2.Selection, null, "ClearContents", new object[0], null, null, null, true);
                    application2.get_Range("C2:C3", Missing.Value).Select();
                    object obj5 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj5, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj5, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj5, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj5, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj5, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj5, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj5, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj5, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj5, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj5 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    application2.get_Range("D3", Missing.Value).Select();
                    NewLateBinding.LateCall(application2.Selection, null, "ClearContents", new object[0], null, null, null, true);
                    application2.get_Range("D2:D3", Missing.Value).Select();
                    object obj6 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj6, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj6, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj6, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj6, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj6, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj6, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj6, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj6, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj6, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj6 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    application2.get_Range("E2:E3", Missing.Value).Select();
                    NewLateBinding.LateCall(application2.Selection, null, "ClearContents", new object[0], null, null, null, true);
                    application2.get_Range("E1:E3", Missing.Value).Select();
                    object obj7 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj7, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj7, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj7, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj7, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj7, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj7, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj7, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj7, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj7, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj7 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    application2.get_Range("F2:F3", Missing.Value).Select();
                    NewLateBinding.LateCall(application2.Selection, null, "ClearContents", new object[0], null, null, null, true);
                    application2.get_Range("F1:F3", Missing.Value).Select();
                    object obj8 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj8, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj8, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj8, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj8, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj8, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj8, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj8, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj8, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj8, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj8 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    string sttLetter = this.GetSttLetter(this.VSlist.Cols.Count - 1);
                    application2.get_Range("H1:" + sttLetter + "1", Missing.Value).Select();
                    NewLateBinding.LateCall(application2.Selection, null, "ClearContents", new object[0], null, null, null, true);
                    application2.get_Range("G1:" + sttLetter + "1", Missing.Value).Select();
                    object obj9 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj9, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj9, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj9, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj9, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj9, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj9, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj9, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj9, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj9, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj9 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    int num2 = this.VSlist.Cols.Count - 3;
                    for (int i = 6; i <= num2; i++)
                    {
                        sttLetter = this.GetSttLetter(i);
                        application2.get_Range(sttLetter + "3", Missing.Value).Select();
                        NewLateBinding.LateCall(application2.Selection, null, "ClearContents", new object[0], null, null, null, true);
                        application2.get_Range(sttLetter + "2:" + sttLetter + "3", Missing.Value).Select();
                        object obj10 = application2.Selection;
                        NewLateBinding.LateSetComplex(obj10, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                        NewLateBinding.LateSetComplex(obj10, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                        NewLateBinding.LateSetComplex(obj10, null, "WrapText", new object[] { true }, null, null, false, true);
                        NewLateBinding.LateSetComplex(obj10, null, "Orientation", new object[] { 0 }, null, null, false, true);
                        NewLateBinding.LateSetComplex(obj10, null, "AddIndent", new object[] { false }, null, null, false, true);
                        NewLateBinding.LateSetComplex(obj10, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                        NewLateBinding.LateSetComplex(obj10, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                        NewLateBinding.LateSetComplex(obj10, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                        NewLateBinding.LateSetComplex(obj10, null, "MergeCells", new object[] { false }, null, null, false, true);
                        obj10 = null;
                        NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    }
                    sttLetter = this.GetSttLetter(this.VSlist.Cols.Count - 1);
                    string str2 = this.GetSttLetter(this.VSlist.Cols.Count - 2);
                    application2.get_Range(sttLetter + "2", Missing.Value).Select();
                    NewLateBinding.LateCall(application2.Selection, null, "ClearContents", new object[0], null, null, null, true);
                    application2.get_Range(str2 + "2:" + sttLetter + "2", Missing.Value).Select();
                    object obj11 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj11, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj11, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj11, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj11, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj11, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj11, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj11, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj11, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj11, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj11 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    sttLetter = this.GetSttLetter(this.VSlist.Cols.Count - 1);
                    application2.get_Range("B1:" + sttLetter + "4", Missing.Value).Select();
                    NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 5 }, null, null, null), null, "LineStyle", new object[] { -4142 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 6 }, null, null, null), null, "LineStyle", new object[] { -4142 }, null, null, false, true);
                    object obj12 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 7 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj12, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj12, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj12, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj12, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj12 = null;
                    object obj13 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 8 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj13, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj13, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj13, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj13, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj13 = null;
                    object obj14 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 9 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj14, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj14, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj14, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj14, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj14 = null;
                    object obj15 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 10 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj15, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj15, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj15, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj15, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj15 = null;
                    object obj16 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 11 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj16, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj16, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj16, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj16, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj16 = null;
                    object obj17 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 12 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj17, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj17, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj17, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj17, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj17 = null;
                    application2.get_Range("B1:B3", Missing.Value).Select();
                    application2.get_Range("B5:" + sttLetter + this.VSlist.Rows.Count.ToString(), Missing.Value).Select();
                    NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 5 }, null, null, null), null, "LineStyle", new object[] { -4142 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 6 }, null, null, null), null, "LineStyle", new object[] { -4142 }, null, null, false, true);
                    object obj18 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 7 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj18, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj18, null, "ColorIndex", new object[] { -4105 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj18, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj18, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj18 = null;
                    object obj19 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 8 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj19, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj19, null, "ColorIndex", new object[] { -4105 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj19, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj19, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj19 = null;
                    object obj20 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 9 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj20, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj20, null, "ColorIndex", new object[] { -4105 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj20, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj20, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj20 = null;
                    object obj21 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 10 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj21, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj21, null, "ColorIndex", new object[] { -4105 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj21, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj21, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj21 = null;
                    object obj22 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 11 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj22, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj22, null, "ColorIndex", new object[] { -4105 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj22, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj22, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj22 = null;
                    object obj23 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 12 }, null, null, null);
                    NewLateBinding.LateSetComplex(obj23, null, "LineStyle", new object[] { -4118 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj23, null, "ColorIndex", new object[] { -4105 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj23, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj23, null, "Weight", new object[] { 2 }, null, null, false, true);
                    obj23 = null;
                    application2.get_Range("C" + Conversions.ToString((int) (this.VSlist.Rows.Count + 2)), Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "- Sổ n\x00e0y c\x00f3 ........ trang, đ\x00e1nh số từ trang 01 đến trang ........";
                    application2.get_Range("C" + Conversions.ToString((int) (this.VSlist.Rows.Count + 3)), Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "- Ng\x00e0y mở sổ:";
                    int num3 = this.VSlist.Rows.Count + 4;
                    application2.get_Range("G" + num3.ToString().Trim(), Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "Ng\x00e0y        th\x00e1ng        năm " + LVYModule.sRight(this.TxtDenNgay.Text, 4);
                    sttLetter = this.GetSttLetter(this.VSlist.Cols.Count - 1);
                    string[] strArray = new string[5];
                    strArray[0] = "G";
                    int num4 = this.VSlist.Rows.Count + 4;
                    strArray[1] = num4.ToString().Trim();
                    strArray[2] = ":";
                    strArray[3] = sttLetter;
                    num3 = this.VSlist.Rows.Count + 4;
                    strArray[4] = num3.ToString().Trim();
                    application2.get_Range(string.Concat(strArray), Missing.Value).Select();
                    object obj24 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj24, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj24, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj24, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj24, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj24, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj24, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj24, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj24, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj24, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj24 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    num4 = this.VSlist.Rows.Count + 5;
                    application2.get_Range("G" + num4.ToString().Trim(), Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "Gi\x00e1m đốc";
                    num4 = this.VSlist.Rows.Count + 6;
                    application2.get_Range("G" + num4.ToString().Trim(), Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "(K\x00fd, họ t\x00ean, đ\x00f3ng dấu)";
                    strArray = new string[5];
                    strArray[0] = "G";
                    num3 = this.VSlist.Rows.Count + 5;
                    strArray[1] = num3.ToString().Trim();
                    strArray[2] = ":";
                    strArray[3] = sttLetter;
                    num4 = this.VSlist.Rows.Count + 5;
                    strArray[4] = num4.ToString().Trim();
                    application2.get_Range(string.Concat(strArray), Missing.Value).Select();
                    object obj25 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj25, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj25, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj25, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj25, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj25, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj25, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj25, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj25, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj25, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj25 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    strArray = new string[5];
                    strArray[0] = "G";
                    num3 = this.VSlist.Rows.Count + 6;
                    strArray[1] = num3.ToString().Trim();
                    strArray[2] = ":";
                    strArray[3] = sttLetter;
                    num4 = this.VSlist.Rows.Count + 6;
                    strArray[4] = num4.ToString().Trim();
                    application2.get_Range(string.Concat(strArray), Missing.Value).Select();
                    object obj26 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj26, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj26, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj26, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj26, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj26, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj26, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj26, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj26, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj26, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj26 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    num4 = this.VSlist.Rows.Count + 5;
                    application2.get_Range("E" + num4.ToString().Trim(), Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "Kế to\x00e1n trưởng";
                    num4 = this.VSlist.Rows.Count + 6;
                    application2.get_Range("E" + num4.ToString().Trim(), Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "(K\x00fd, họ t\x00ean)";
                    num3 = this.VSlist.Rows.Count + 5;
                    num4 = this.VSlist.Rows.Count + 5;
                    application2.get_Range("E" + num3.ToString().Trim() + ":F" + num4.ToString().Trim(), Missing.Value).Select();
                    object obj27 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj27, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj27, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj27, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj27, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj27, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj27, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj27, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj27, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj27, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj27 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    num3 = this.VSlist.Rows.Count + 6;
                    num4 = this.VSlist.Rows.Count + 6;
                    application2.get_Range("E" + num3.ToString().Trim() + ":F" + num4.ToString().Trim(), Missing.Value).Select();
                    object obj28 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj28, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj28, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj28, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj28, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj28, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj28, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj28, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj28, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj28, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj28 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    num4 = this.VSlist.Rows.Count + 5;
                    application2.get_Range("B" + num4.ToString().Trim(), Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "Người ghi sổ";
                    num4 = this.VSlist.Rows.Count + 6;
                    application2.get_Range("B" + num4.ToString().Trim(), Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "(K\x00fd, họ t\x00ean)";
                    num3 = this.VSlist.Rows.Count + 5;
                    num4 = this.VSlist.Rows.Count + 5;
                    application2.get_Range("B" + num3.ToString().Trim() + ":D" + num4.ToString().Trim(), Missing.Value).Select();
                    object obj29 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj29, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj29, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj29, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj29, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj29, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj29, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj29, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj29, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj29, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj29 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    num3 = this.VSlist.Rows.Count + 6;
                    num4 = this.VSlist.Rows.Count + 6;
                    application2.get_Range("B" + num3.ToString().Trim() + ":D" + num4.ToString().Trim(), Missing.Value).Select();
                    object obj30 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj30, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj30, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj30, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj30, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj30, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj30, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj30, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj30, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj30, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj30 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    NewLateBinding.LateCall(application2.Rows["1:3", Missing.Value], null, "Select", new object[0], null, null, null, true);
                    application2.get_Range("A3", Missing.Value).Activate();
                    NewLateBinding.LateCall(NewLateBinding.LateGet(application2.Rows["1:3", Missing.Value], null, "EntireRow", new object[0], null, null, null), null, "AutoFit", new object[0], null, null, null, true);
                    NewLateBinding.LateCall(application2.Rows["1:3", Missing.Value], null, "Select", new object[0], null, null, null, true);
                    NewLateBinding.LateCall(application2.Selection, null, "Insert", new object[] { -4121, 0 }, new string[] { "Shift", "CopyOrigin" }, null, null, true);
                    NewLateBinding.LateCall(application2.Selection, null, "Insert", new object[] { -4121, 0 }, new string[] { "Shift", "CopyOrigin" }, null, null, true);
                    NewLateBinding.LateCall(application2.Rows["1:2", Missing.Value], null, "Select", new object[0], null, null, null, true);
                    NewLateBinding.LateCall(application2.Selection, null, "Insert", new object[] { 0x1019, 0 }, new string[] { "Shift", "CopyOrigin" }, null, null, true);
                    application2.get_Range("D3", Missing.Value).Select();
                    application2.get_Range("B1", Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "Đơn vị:" + modGeneral.H_COMPANYNAMEVIET;
                    application2.get_Range("B2", Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "Địa chỉ:" + modGeneral.H_ADDRESSVIET;
                    application2.get_Range("G2", Missing.Value).Select();
                    if (modGeneral.H_PHIENBANQUYETDINH == "QD15")
                    {
                        application2.ActiveCell.FormulaR1C1 = "Mẫu số S03a2-DN";
                    }
                    else
                    {
                        application2.ActiveCell.FormulaR1C1 = "Mẫu số S03a2-DNN";
                    }
                    application2.get_Range("G2:" + sttLetter + "2", Missing.Value).Select();
                    object obj31 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj31, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj31, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj31, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj31, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj31, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj31, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj31, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj31, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj31, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj31 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    application2.get_Range("G3", Missing.Value).Select();
                    if (modGeneral.H_PHIENBANQUYETDINH == "QD15")
                    {
                        application2.ActiveCell.FormulaR1C1 = "(Ban h\x00e0nh theo QĐ số 15/2006/QĐ-BTC";
                    }
                    else
                    {
                        application2.ActiveCell.FormulaR1C1 = "(Ban h\x00e0nh theo QĐ số 48/2006/QĐ-BTC";
                    }
                    application2.get_Range("G3:" + sttLetter + "3", Missing.Value).Select();
                    object obj32 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj32, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj32, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj32, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj32, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj32, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj32, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj32, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj32, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj32, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj32 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    application2.get_Range("G4", Missing.Value).Select();
                    if (modGeneral.H_PHIENBANQUYETDINH == "QD15")
                    {
                        application2.ActiveCell.FormulaR1C1 = "ng\x00e0y 20/03/2006 của Bộ trưởng Bộ t\x00e0i ch\x00ednh)";
                    }
                    else
                    {
                        application2.ActiveCell.FormulaR1C1 = "ng\x00e0y 14/09/2006 của Bộ trưởng Bộ t\x00e0i ch\x00ednh)";
                    }
                    application2.get_Range("G4:" + sttLetter + "4", Missing.Value).Select();
                    object obj33 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj33, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj33, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj33, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj33, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj33, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj33, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj33, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj33, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj33, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj33 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    application2.get_Range("B6", Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "SỔ NHẬT K\x00dd CHI TIỀN";
                    NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Font", new object[0], null, null, null), null, "Bold", new object[] { true }, null, null, false, true);
                    object obj34 = NewLateBinding.LateGet(application2.Selection, null, "Font", new object[0], null, null, null);
                    NewLateBinding.LateSetComplex(obj34, null, "Name", new object[] { "Times New Roman" }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj34, null, "Size", new object[] { 0x10 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj34, null, "Strikethrough", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj34, null, "Superscript", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj34, null, "Subscript", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj34, null, "OutlineFont", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj34, null, "Shadow", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj34, null, "Underline", new object[] { -4142 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj34, null, "ColorIndex", new object[] { 1 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj34, null, "TintAndShade", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj34, null, "ThemeFont", new object[] { 0 }, null, null, false, true);
                    obj34 = null;
                    application2.get_Range("B6:" + sttLetter + "6", Missing.Value).Select();
                    object obj35 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj35, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj35, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj35, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj35, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj35, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj35, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj35, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj35, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj35, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj35 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    NewLateBinding.LateCall(NewLateBinding.LateGet(application2.Rows["6:6", Missing.Value], null, "EntireRow", new object[0], null, null, null), null, "AutoFit", new object[0], null, null, null, true);
                    string str3 = "";
                    if ((LVYModule.sLeft(this.TxtTuNgay.Text, 5) == "01/01") & (LVYModule.sLeft(this.TxtDenNgay.Text, 5) == "31/12"))
                    {
                        str3 = modGeneral.Tranlated("Năm", "") + " " + LVYModule.sRight(this.TxtTuNgay.Text, 4);
                    }
                    else
                    {
                        str3 = modGeneral.Tranlated("Từ ng\x00e0y", "") + " :" + this.TxtTuNgay.Text + " " + modGeneral.Tranlated("đến ng\x00e0y", "") + ":" + this.TxtDenNgay.Text;
                    }
                    application2.get_Range("B7", Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = str3;
                    NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Font", new object[0], null, null, null), null, "Bold", new object[] { true }, null, null, false, true);
                    application2.get_Range("B7:" + sttLetter + "7", Missing.Value).Select();
                    object obj36 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj36, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj36, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj36, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj36, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj36, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj36, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj36, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj36, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj36, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj36 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    application2.get_Range("B8", Missing.Value).Select();
                    application2.ActiveCell.FormulaR1C1 = "Đơn vị t\x00ednh:Đ";
                    application2.get_Range("B8:" + sttLetter + "8", Missing.Value).Select();
                    object obj37 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj37, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj37, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj37, null, "WrapText", new object[] { true }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj37, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj37, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj37, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj37, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj37, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj37, null, "MergeCells", new object[] { false }, null, null, false, true);
                    obj37 = null;
                    NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                    object obj38 = application2.Selection;
                    NewLateBinding.LateSetComplex(obj38, null, "HorizontalAlignment", new object[] { -4152 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj38, null, "VerticalAlignment", new object[] { -4107 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj38, null, "WrapText", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj38, null, "Orientation", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj38, null, "AddIndent", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj38, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj38, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                    NewLateBinding.LateSetComplex(obj38, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                    obj38 = null;
                    application2 = null;
                    application.ActiveWorkbook.Save();
                    application.Visible = true;
                }
            }
            catch (COMException exception1)
            {
                ProjectData.SetProjectError(exception1);
                COMException exception = exception1;
                MessageBox.Show(exception.Message);
                ProjectData.ClearProjectError();
            }
            catch (Exception exception3)
            {
                ProjectData.SetProjectError(exception3);
                Exception exception2 = exception3;
                MessageBox.Show(exception2.Message);
                ProjectData.ClearProjectError();
            }
        }

        private void CmdLoad_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void Frm_RptSoNhatKyThuTien_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Dispose();
        }

        private void Frm_RptSoNhatKyThuTien_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                this.Cursor = Cursors.Default;
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.objTK.LoadByCode("111");
                this.AdvTaiKhoan.Value = this.objTK.Khoa;
                this.TxtTuNgay.Text = "01/" + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + "/" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today));
                this.MergeCell();
                this.LoadData();
                this.Cursor = Cursors.Default;
            }
        }

        public int GetCols(string strSoTaiKhoan)
        {
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            int num3 = vSlist.Cols.Count - 1;
            for (int i = 6; i <= num3; i++)
            {
                if (vSlist[2, i].ToString().Trim() == strSoTaiKhoan.Trim())
                {
                    return i;
                }
            }
            vSlist = null;
            return 0;
        }

        public System.Data.DataTable GetData()
        {
            string str = this.AdvTaiKhoan.TxtCode.Text.Trim();
            string commandText = " select NK.KhoaChungTu, NK.SoChungTu, dbo.Char2Date(NK.NgayChungTu) As Ngay, NK.DienGiai,  NK.SoPhatSinh, TKN.SoTaiKhoan As TaiKhoanNo, TKC.SoTaiKhoan As TaiKhoanCo, NK.SoPhatSinh  from GL_NhatKyChungTu NK Left join DM_TaiKhoan TKN ON NK.KhoaTaiKhoanNo = TKN.Khoa  left join DM_TaiKhoan TKC ON NK.KhoaTaiKhoanCo = TKC.Khoa  where NK.KhoaTaiKhoanCo IN  (SELECT Khoa FROM DM_TaiKhoan WHERE Left(SoTaiKhoan, Len(Rtrim('" + str + "'))) = Rtrim('" + str + "'))  and (NK.NgayChungTu Between '" + LVYModule.Date2Char(this.TxtTuNgay.Text) + "' And '" + LVYModule.Date2Char(this.TxtDenNgay.Text) + "') order by NK.NgayChungTu, NK.SoChungTu, TaiKhoanCo ";
            return DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
        }

        public string GetSttLetter(int nCol)
        {
            string[] strArray = new string[0x29];
            int num2 = 0x41;
            int num3 = nCol;
            for (int i = 0; i <= num3; i++)
            {
                strArray[i] = Conversions.ToString(Strings.Chr(num2 + i));
            }
            return strArray[nCol];
        }

        public System.Data.DataTable GetTKDoi()
        {
            string commandText = " select NK.KhoaChungTu, NK.SoChungTu, dbo.Char2Date(NK.NgayChungTu) As Ngay, NK.DienGiai,  NK.SoPhatSinh, TKN.SoTaiKhoan As TaiKhoanNo, TKC.SoTaiKhoan As TaiKhoanCo, NK.SoPhatSinh  from GL_NhatKyChungTu NK Left join DM_TaiKhoan TKN ON NK.KhoaTaiKhoanNo = TKN.Khoa  left join DM_TaiKhoan TKC ON NK.KhoaTaiKhoanCo = TKC.Khoa  where NK.KhoaTaiKhoanNo IN  (SELECT Khoa FROM DM_TaiKhoan WHERE Left(SoTaiKhoan, Len(Rtrim(@SoTaiKhoan))) = Rtrim(@SoTaiKhoan))  and (NK.NgayChungTu Between '" + LVYModule.Date2Char(this.TxtTuNgay.Text) + "' And '" + LVYModule.Date2Char(this.TxtDenNgay.Text) + "') order by NK.NgayChungTu, NK.SoChungTu, TaiKhoanCo ";
            return DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_RptSoNhatKyChiTien));
            this.Panel1 = new Panel();
            this.Label2 = new System.Windows.Forms.Label();
            this.AdvTaiKhoan = new ADVAccount();
            this.CmdCancel = new System.Windows.Forms.Button();
            this.CmdExel = new System.Windows.Forms.Button();
            this.CmdPrint = new System.Windows.Forms.Button();
            this.CmdLoad = new System.Windows.Forms.Button();
            this.Label1 = new System.Windows.Forms.Label();
            this.TxtDenNgay = new DateTimePicker();
            this.Label13 = new System.Windows.Forms.Label();
            this.TxtTuNgay = new DateTimePicker();
            this.Panel2 = new Panel();
            this.Label3 = new System.Windows.Forms.Label();
            this.TxtTongCong = new C1NumericEdit();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel1.SuspendLayout();
            this.Panel2.SuspendLayout();
            ((ISupportInitialize) this.TxtTongCong).BeginInit();
            this.VSlist.BeginInit();
            this.SuspendLayout();
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.Label2);
            this.Panel1.Controls.Add(this.AdvTaiKhoan);
            this.Panel1.Controls.Add(this.CmdCancel);
            this.Panel1.Controls.Add(this.CmdExel);
            this.Panel1.Controls.Add(this.CmdPrint);
            this.Panel1.Controls.Add(this.CmdLoad);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.TxtDenNgay);
            this.Panel1.Controls.Add(this.Label13);
            this.Panel1.Controls.Add(this.TxtTuNgay);
            this.Panel1.Dock = DockStyle.Top;
            System.Drawing.Point point = new System.Drawing.Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            Size size = new Size(0x3e2, 0x2f);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x7a;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0xba, 4);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x37, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 120;
            this.Label2.Text = "T\x00e0i khoản";
            this.AdvTaiKhoan.Conditions = "";
            this.AdvTaiKhoan.DefaultValue = "";
            this.AdvTaiKhoan.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTaiKhoan.KeyFilter = "111";
            point = new System.Drawing.Point(0xbd, 20);
            this.AdvTaiKhoan.Location = point;
            Padding padding = new Padding(0);
            this.AdvTaiKhoan.Margin = padding;
            this.AdvTaiKhoan.Name = "AdvTaiKhoan";
            this.AdvTaiKhoan.OnlyDigit = false;
            this.AdvTaiKhoan.ReadOnly = false;
            size = new Size(0x131, 20);
            this.AdvTaiKhoan.Size = size;
            this.AdvTaiKhoan.TabIndex = 0x77;
            this.AdvTaiKhoan.UpperText = true;
            this.AdvTaiKhoan.Value = "";
            this.AdvTaiKhoan.WithCode = 80;
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x389, 0x10);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x4f, 0x19);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 0x76;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdExel.Image = (Image) manager.GetObject("CmdExel.Image");
            this.CmdExel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x335, 0x10);
            this.CmdExel.Location = point;
            this.CmdExel.Name = "CmdExel";
            size = new Size(0x53, 0x19);
            this.CmdExel.Size = size;
            this.CmdExel.TabIndex = 0x75;
            this.CmdExel.Text = "&Excel";
            this.CmdExel.UseVisualStyleBackColor = true;
            this.CmdPrint.Image = ACCOUNTING.My.Resources.Resources.report;
            this.CmdPrint.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x308, 0x2f);
            this.CmdPrint.Location = point;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x53, 0x19);
            this.CmdPrint.Size = size;
            this.CmdPrint.TabIndex = 0x74;
            this.CmdPrint.Text = "Trang in";
            this.CmdPrint.UseVisualStyleBackColor = true;
            this.CmdLoad.Image = (Image) manager.GetObject("CmdLoad.Image");
            this.CmdLoad.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x2e1, 0x10);
            this.CmdLoad.Location = point;
            this.CmdLoad.Name = "CmdLoad";
            size = new Size(0x53, 0x19);
            this.CmdLoad.Size = size;
            this.CmdLoad.TabIndex = 0x73;
            this.CmdLoad.Text = "Load";
            this.CmdLoad.UseVisualStyleBackColor = true;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0x5d, 4);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x35, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x3f;
            this.Label1.Text = "Đến ng\x00e0y";
            this.TxtDenNgay.Format = DateTimePickerFormat.Custom;
            point = new System.Drawing.Point(0x60, 20);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x55, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x3e;
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new System.Drawing.Point(4, 6);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x2e, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x3d;
            this.Label13.Text = "Từ ng\x00e0y";
            this.TxtTuNgay.Format = DateTimePickerFormat.Custom;
            point = new System.Drawing.Point(7, 20);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x53, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 60;
            this.Panel2.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel2.Controls.Add(this.Label3);
            this.Panel2.Controls.Add(this.TxtTongCong);
            this.Panel2.Dock = DockStyle.Bottom;
            point = new System.Drawing.Point(0, 0x281);
            this.Panel2.Location = point;
            this.Panel2.Name = "Panel2";
            size = new Size(0x3e2, 0x1f);
            this.Panel2.Size = size;
            this.Panel2.TabIndex = 0x7c;
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0x332, 9);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x3b, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x88;
            this.Label3.Text = "Tổng cộng";
            this.TxtTongCong.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongCong.DataType = typeof(double);
            this.TxtTongCong.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(0x36f, 6);
            this.TxtTongCong.Location = point;
            this.TxtTongCong.Name = "TxtTongCong";
            padding = new Padding(1);
            this.TxtTongCong.Padding = padding;
            this.TxtTongCong.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTongCong.Size = size;
            this.TxtTongCong.TabIndex = 0x87;
            this.TxtTongCong.Tag = null;
            this.TxtTongCong.TextAlign = HorizontalAlignment.Right;
            this.TxtTongCong.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongCong.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongCong.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.VSlist.AllowEditing = false;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.FocusRect = FocusRectEnum.None;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new System.Drawing.Point(0, 0x2f);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 4;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.Rows.Fixed = 4;
            this.VSlist.Rows.MaxSize = 0x12;
            this.VSlist.Rows.MinSize = 0x12;
            this.VSlist.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x3e2, 0x252);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 0x7b;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x3e2, 0x2a0);
            this.ClientSize = size;
            this.Controls.Add(this.VSlist);
            this.Controls.Add(this.Panel1);
            this.Controls.Add(this.Panel2);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_RptSoNhatKyChiTien";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "SS-0002";
            this.Text = "NHAT KY CHI TIETN";
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.Panel2.ResumeLayout(false);
            this.Panel2.PerformLayout();
            ((ISupportInitialize) this.TxtTongCong).EndInit();
            this.VSlist.EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            int num2;
            this.Cursor = Cursors.WaitCursor;
            System.Data.DataTable data = this.GetData();
            double num3 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            vSlist.Rows.Count = 4;
            int num4 = data.Rows.Count - 1;
            for (num2 = 0; num2 <= num4; num2++)
            {
                vSlist.AddItem("");
                vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(data.Rows[num2]["KhoaChungTu"]);
                vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(data.Rows[num2]["Ngay"]);
                vSlist[vSlist.Rows.Count - 1, 2] = data.Rows[num2]["SoChungTu"].ToString().Trim();
                vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(data.Rows[num2]["Ngay"]);
                vSlist[vSlist.Rows.Count - 1, 4] = data.Rows[num2]["DienGiai"].ToString().Trim();
                vSlist[vSlist.Rows.Count - 1, 5] = data.Rows[num2]["TaiKhoanCo"].ToString().Trim();
                int cols = this.GetCols(data.Rows[num2]["TaiKhoanNo"].ToString().Trim());
                if (cols == 0)
                {
                    cols = this.GetCols("...");
                    if (cols == 0)
                    {
                        vSlist.Cols.Insert(vSlist.Cols.Count - 2);
                        cols = vSlist.Cols.Count - 3;
                        vSlist.Cols[cols].AllowMerging = true;
                        vSlist.Cols[cols].Width = 70;
                        vSlist.Cols[cols].DataType = System.Type.GetType("System.Decimal");
                        vSlist.Cols[cols].TextAlignFixed = TextAlignEnum.CenterCenter;
                        vSlist.Cols[cols].Format = modGeneral.H_FORMATNUMBER;
                        vSlist[0, cols] = RuntimeHelpers.GetObjectValue(vSlist[0, 6]);
                        vSlist[1, cols] = data.Rows[num2]["TaiKhoanNo"].ToString().Trim();
                        vSlist[2, cols] = data.Rows[num2]["TaiKhoanNo"].ToString().Trim();
                        vSlist[vSlist.Rows.Count - 1, cols] = RuntimeHelpers.GetObjectValue(data.Rows[num2]["SoPhatSinh"]);
                    }
                    else
                    {
                        vSlist[1, cols] = data.Rows[num2]["TaiKhoanNo"].ToString().Trim();
                        vSlist[2, cols] = data.Rows[num2]["TaiKhoanNo"].ToString().Trim();
                        vSlist[vSlist.Rows.Count - 1, cols] = RuntimeHelpers.GetObjectValue(data.Rows[num2]["SoPhatSinh"]);
                    }
                }
                else
                {
                    vSlist[1, cols] = data.Rows[num2]["TaiKhoanNo"].ToString().Trim();
                    vSlist[2, cols] = data.Rows[num2]["TaiKhoanNo"].ToString().Trim();
                    vSlist[vSlist.Rows.Count - 1, cols] = RuntimeHelpers.GetObjectValue(data.Rows[num2]["SoPhatSinh"]);
                }
                num3 += Conversion.Val(RuntimeHelpers.GetObjectValue(data.Rows[num2]["SoPhatSinh"]));
            }
            int num5 = vSlist.Cols.Count - 1;
            for (num2 = 5; num2 <= num5; num2++)
            {
                vSlist[3, num2] = num2 - 4;
            }
            vSlist[3, vSlist.Cols.Count - 1] = "E";
            LVYModule.advFormatNumber(this.TxtTongCong, modGeneral.H_FORMATNUMBER);
            this.TxtTongCong.Value = num3;
            vSlist = null;
            this.Cursor = Cursors.Default;
        }

        public void MergeCell()
        {
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            vSlist.Rows.Count = 4;
            vSlist.Rows.Fixed = 4;
            vSlist[1, 1] = RuntimeHelpers.GetObjectValue(vSlist[0, 1]);
            vSlist[2, 1] = RuntimeHelpers.GetObjectValue(vSlist[0, 1]);
            vSlist[3, 1] = "A";
            vSlist[1, 2] = modGeneral.Tranlated("Số", "");
            vSlist[2, 2] = RuntimeHelpers.GetObjectValue(vSlist[1, 2]);
            vSlist[3, 2] = "B";
            vSlist[1, 3] = modGeneral.Tranlated("Ng\x00e0y th\x00e1ng", "");
            vSlist[2, 3] = RuntimeHelpers.GetObjectValue(vSlist[1, 3]);
            vSlist[3, 3] = "C";
            vSlist[1, 4] = RuntimeHelpers.GetObjectValue(vSlist[0, 4]);
            vSlist[2, 4] = RuntimeHelpers.GetObjectValue(vSlist[0, 4]);
            vSlist[3, 4] = "D";
            vSlist[1, 5] = RuntimeHelpers.GetObjectValue(vSlist[0, 5]);
            vSlist[2, 5] = RuntimeHelpers.GetObjectValue(vSlist[0, 5]);
            int num2 = vSlist.Cols.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                vSlist.Cols[i].AllowMerging = true;
                vSlist.Cols[i].TextAlignFixed = TextAlignEnum.CenterCenter;
                vSlist.Cols[i].StyleFixed.WordWrap = true;
                if (i >= 5)
                {
                    vSlist[3, i] = i - 4;
                }
                if (i > 5)
                {
                    vSlist[1, i] = "...";
                    vSlist[2, i] = "...";
                    vSlist.Cols[i].DataType = System.Type.GetType("System.Decimal");
                    vSlist.Cols[i].Format = modGeneral.H_FORMATNUMBER;
                    vSlist.Cols[i].Width = 70;
                }
            }
            vSlist[1, vSlist.Cols.Count - 2] = modGeneral.Tranlated("T\x00e0i khoản kh\x00e1c", "");
            vSlist[1, vSlist.Cols.Count - 1] = modGeneral.Tranlated("T\x00e0i khoản kh\x00e1c", "");
            vSlist[2, vSlist.Cols.Count - 2] = modGeneral.Tranlated("Số tiền", "");
            vSlist[2, vSlist.Cols.Count - 1] = modGeneral.Tranlated("Số hiệu", "");
            vSlist.Rows[0].AllowMerging = true;
            vSlist.Rows[1].AllowMerging = true;
            vSlist.Cols[vSlist.Cols.Count - 1].Width = 50;
            vSlist.AllowMerging = AllowMergingEnum.FixedOnly;
            vSlist[3, vSlist.Cols.Count - 1] = "E";
            vSlist = null;
        }

        private void TxtTuNgay_LostFocus(object sender, EventArgs e)
        {
            if (LVYModule.sRight(this.TxtTuNgay.Text, 7) != LVYModule.sRight(this.TxtDenNgay.Text, 7))
            {
                this.TxtDenNgay.Text = DateTime.DaysInMonth(Conversions.ToInteger(LVYModule.sRight(this.TxtTuNgay.Text, 4)), Conversions.ToInteger(LVYModule.sMid(this.TxtTuNgay.Text, 4, 2))).ToString() + "/" + LVYModule.sRight(this.TxtTuNgay.Text, 7);
            }
        }

        internal virtual ADVAccount AdvTaiKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoan = value;
            }
        }

        internal virtual System.Windows.Forms.Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdExel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExel_Click);
                if (this._CmdExel != null)
                {
                    this._CmdExel.Click -= handler;
                }
                this._CmdExel = value;
                if (this._CmdExel != null)
                {
                    this._CmdExel.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdLoad
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdLoad;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdLoad_Click);
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click -= handler;
                }
                this._CmdLoad = value;
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdPrint = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel2 = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual C1NumericEdit TxtTongCong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongCong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongCong = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTuNgay_LostFocus);
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus -= handler;
                }
                this._TxtTuNgay = value;
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSlist = value;
            }
        }
    }
}

